package com.my.cd.mediator;

/**
 * 具体工作者：电视机
 */
public class TV extends Worker {

    public TV(String name, Mediator mediator) {
        super(name, mediator);
        mediator.register(name, this);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().receiveMessage(this.name, stateChange);
    }

    public void startTv() {
        System.out.println("It's time to StartTv!");
    }

    public void stopTv() {
        System.out.println("StopTv!");
    }
}
